export const ftlSnippets = [
  {
    label: 'assign',
    documentation: '赋值',
    insertText: ['<#assign ${1:name} = ${2:value} >'].join('\n')
  },
  {
    label: 'if',
    documentation: '条件判断',
    insertText: ['<#if ${1:condition}>', '    ${2:code}', '<#elseif ${3:condition}>', '    ${4:code}', '<#else>', '    ${5:code}', '</#if>'].join('\n')
  },
  {
    label: 'else',
    documentation: '否则',
    insertText: ['<#else>', '    ${1:code}'].join('\n')
  },
  {
    label: 'elseif',
    documentation: '否则如果',
    insertText: ['<#elseif ${1:condition}>', '    ${2:code}'].join('\n')
  },
  {
    label: 'local',
    documentation: '局部变量',
    insertText: ['<#local ${1:name} = ${2:value} >'].join('\n')
  },
  {
    label: 'list',
    documentation: '列表',
    insertText: ['<#list ${1:list} as ${2:item}>', '    ${3:code}', '</#list>'].join('\n')
  },
  {
    label: 'break',
    documentation: '中断',
    insertText: ['<#break>'].join('\n')
  },
  {
    label: 'return',
    documentation: '返回',
    insertText: ['<#return ${1:value}>'].join('\n')
  },
  {
    label: 'switch',
    documentation: '开关',
    insertText: ['<#switch ${1:value}>', '    <#case ${2:value}>', '        ${3:code}', '</#switch>'].join('\n')
  },
  {
    label: 'default',
    documentation: '默认',
    insertText: ['<#default>', '    ${1:code}', '</#default>'].join('\n')
  },
  {
    label: 'include',
    documentation: '包含',
    insertText: ['<#include "${1:file}" />'].join('\n')
  },
  {
    label: 'import',
    documentation: '导入',
    insertText: ['<#import "${1:file}" as ${2:name} />'].join('\n')
  },
  {
    label: 'macro',
    documentation: '宏',
    insertText: ['<#macro ${1:name} ${2:params}>', '    ${3:code}', '</#macro>'].join('\n')
  },
  {
    label: 'nested',
    documentation: '嵌套',
    insertText: ['<#nested />'].join('\n')
  },
  {
    label: 'defaultProps',
    documentation: '默认属性',
    insertText: ['<#local defaultProps = fmTemplateManager.getProperties(${1:id})>', '<#local props = defaultProps + (props?has_content?then(props, {})) >'].join('\n')
  },
  {
    label: 'getTemplatePath',
    documentation: '获取指定id模板的路径',
    insertText: ['<#local path = fmTemplateManager.getPath(${1:id}) >'].join('\n')
  },
  {
    label: 'getTemplateProps',
    documentation: '获取指定id模板的properties',
    insertText: ['<#local props = fmTemplateManager.getProperties(${1:id}) >'].join('\n')
  },
  {
    label: 'getSiteInfo',
    documentation: '获取站点信息',
    insertText: ['<#local site = fmSiteManager.selectById(${1:siteId}) >'].join('\n')
  },
  {
    label: 'getCategoryTree',
    documentation: '获取指定站点栏目下的栏目树',
    insertText: ['<#local categoryTree = fmCategoryManager.selectTreeById(${1:siteId}, ${2:catId}, ${3:isShow}, ${4:state}) >'].join('\n')
  },
  {
    label: 'getCategory',
    documentation: '获取栏目信息',
    insertText: ['<#local category = fmCategoryManager.selectById(${1:catId}) >'].join('\n')
  },
  {
    label: 'getCategoryByLevel',
    documentation: '获取栏目链上的任意级栏目',
    insertText: ['<#local category = fmCategoryManager.selectByIdAndLevel(${1:catId}, ${2:level}) >'].join('\n')
  },
  {
    label: 'getPCategoryByLevel',
    documentation: '获取指定层级的所有栏目',
    insertText: ['<#local categories = fmCategoryManager.selectPCategoryByIdAndLevel(${1:catId}, ${2:level}) >'].join('\n')
  },
  {
    label: 'getCategoriesByIds',
    documentation: '批量获取栏目详情',
    insertText: ['<#local categories = fmCategoryManager.selectByIds([${1:ids}]) >'].join('\n')
  },
  {
    label: 'getCategoriesByPid',
    documentation: '获取栏目内容分类',
    insertText: ['<#local categories = fmCategoryManager.selectByPidAndInfo(${1:pid}, {"class":"${2:page0}"}) >'].join('\n')
  },
  {
    label: 'getFileUrl',
    documentation: '获取文件地址',
    insertText: ['<#local fileUrl = fmContentManager.selectFileUrlById(${1:fileId}) >'].join('\n')
  },
  {
    label: 'getContent',
    documentation: '获取内容详情',
    insertText: ['<#local content = fmContentManager.selectByCatIdAndDid(${1:catId}, ${2:did}) >'].join('\n')
  },
  {
    label: 'getContentList',
    documentation: '批量获取内容详情',
    insertText: ['<#local contents = fmContentManager.selectList([{"catId":${1:catId},"dataIds":[${2:ids}]}]) >'].join('\n')
  },
  {
    label: 'getContentPage',
    documentation: '获取列表数据',
    insertText: [
      '<#local page = fmContentManager.selectPage(',
      '    ${1:currentPage},', 
      '    ${2:pageSize},',
      '    ${3:catId},',
      '    ${4:status},',
      '    ${5:params},',
      '    "${6:orderField}",',
      '    "${7:orderType}"',
      ') >'
    ].join('\n')
  },
  {
    label: 'r_div',
    documentation: '基础div容器',
    insertText: ['<@r_div ${1:editor1} extraClasses="" extraStyle="">', '    ${2:content}', '</@r_div>'].join('\n')
  },
  {
    label: 'r_footer',
    documentation: '页脚容器',
    insertText: ['<@r_footer ${1:editor1} extraClasses="" extraStyle="">', '    ${2:content}', '</@r_footer>'].join('\n')
  },
  {
    label: 'r_h1',
    documentation: 'h1标题',
    insertText: ['<@r_h1 ${1:editor1} extraClasses="" extraStyle="">', '    ${2:content}', '</@r_h1>'].join('\n')
  },
  {
    label: 'r_ul',
    documentation: '无序列表',
    insertText: ['<@r_ul ${1:editor1} extraClasses="" extraStyle="">', '    ${2:content}', '</@r_ul>'].join('\n')
  },
  {
    label: 'r_li',
    documentation: '列表项',
    insertText: ['<@r_li ${1:editor1} extraClasses="" extraStyle="">', '    ${2:content}', '</@r_li>'].join('\n')
  },
  {
    label: 'r_a',
    documentation: '链接',
    insertText: ['<@r_a ${1:editor1} data={} isClickable=true extraClasses="" extraStyle="" isBlank=false extraAttr="">', '    ${2:content}', '</@r_a>'].join('\n')
  },
  {
    label: 'r_p',
    documentation: '段落',
    insertText: ['<@r_p ${1:editor1} extraClasses="" extraStyle="">', '    ${2:content}', '</@r_p>'].join('\n')
  },
  {
    label: 'r_span',
    documentation: '行内元素',
    insertText: ['<@r_span ${1:editor1} extraClasses="" extraStyle="">', '    ${2:content}', '</@r_span>'].join('\n')
  },
  {
    label: 'r_i',
    documentation: '斜体',
    insertText: ['<@r_i ${1:editor1} extraClasses="" extraStyle="">', '    ${2:content}', '</@r_i>'].join('\n')
  },
  {
    label: 'r_u',
    documentation: '下划线',
    insertText: ['<@r_u ${1:editor1} extraClasses="" extraStyle="">', '    ${2:content}', '</@r_u>'].join('\n')
  },
  {
    label: 'r_p_ellipsis',
    documentation: '省略段落',
    insertText: ['<@r_p_ellipsis ${1:editor1} extraClasses="" extraStyle="">', '    ${2:content}', '</@r_p_ellipsis>'].join('\n')
  },
  {
    label: 'r_inner_container',
    documentation: '内页容器',
    insertText: ['<@r_inner_container ${1:editor1} extraClasses="" extraStyle="">', '    ${2:content}', '</@r_inner_container>'].join('\n')
  },
  {
    label: 'r_img',
    documentation: '图片容器',
    insertText: ['<@r_img ${1:editor1} extraClasses="" extraStyle="">', '    ${2:content}', '</@r_img>'].join('\n')
  },
  {
    label: 'r_cropImg',
    documentation: '裁剪图片',
    insertText: ['<@r_cropImg params={', '    "url": "${1:url}",', '    "scaledWidth": ${2:width},', '    "scaledHeight": ${3:height},', '    "startX": ${4:0},', '    "startY": ${5:0},', '    "cropWidth": ${6:width},', '    "cropHeight": ${7:height}', '} extraClasses="crop-img"/>'].join('\n')
  },
  {
    label: 'r_column_tit_001_a',
    documentation: '栏目标题001(链接)',
    insertText: ['<@r_column_tit_001_a ${1:editor1} data={} isClickable=true extraClasses="" extraStyle="">', '    ${2:content}', '</@r_column_tit_001_a>'].join('\n')
  },
  {
    label: 'r_column_tit_001_p',
    documentation: '栏目标题001(段落)',
    insertText: ['<@r_column_tit_001_p ${1:editor1} data={} isClickable=true extraClasses="" extraStyle="">', '    ${2:content}', '</@r_column_tit_001_p>'].join('\n')
  },
  {
    label: 'r_party_tit_001',
    documentation: '党建标题001',
    insertText: ['<@r_party_tit_001 ${1:editor1} data={} isClickable=true extraClasses="" extraStyle="">', '    ${2:content}', '</@r_party_tit_001>'].join('\n')
  },
  {
    label: 'r_party_tit_002',
    documentation: '党建标题002',
    insertText: ['<@r_party_tit_002 ${1:editor1} data={} isClickable=true extraClasses="" extraStyle="">', '    ${2:content}', '</@r_party_tit_002>'].join('\n')
  },
  {
    label: 'r_column_tab_tit_001',
    documentation: '栏目标题tab切换001',
    insertText: ['<@r_column_tab_tit_001 ${1:editor1} ids=[] extraClasses="" extraStyle="">', '    ${2:content}', '</@r_column_tab_tit_001>'].join('\n')
  },
  {
    label: 'r_more_001',
    documentation: '更多按钮001',
    insertText: ['<@r_more_001 ${1:editor1} data={} extraClasses="" extraStyle="">', '    ${2:content}', '</@r_more_001>'].join('\n')
  },
  {
    label: 'r_party_more_001',
    documentation: '党建更多按钮001',
    insertText: ['<@r_party_more_001 ${1:editor1} data={} extraClasses="" extraStyle="">', '    ${2:content}', '</@r_party_more_001>'].join('\n')
  },
  {
    label: 'r_column_tit_004_a',
    documentation: '栏目标题004(链接)',
    insertText: ['<@r_column_tit_004_a ${1:editor1} data={} isClickable=true extraClasses="" extraStyle="">', '    ${2:content}', '</@r_column_tit_004_a>'].join('\n')
  },
  {
    label: 'r_column_tit_003_a',
    documentation: '栏目标题003(链接)',
    insertText: ['<@r_column_tit_003_a ${1:editor1} data={} isClickable=true extraClasses="" extraStyle="">', '    ${2:content}', '</@r_column_tit_003_a>'].join('\n')
  },
  {
    label: 'r_column_tit_002_a',
    documentation: '栏目标题002(链接)',
    insertText: ['<@r_column_tit_002_a ${1:editor1} data={} isClickable=true extraClasses="" extraStyle="">', '    ${2:content}', '</@r_column_tit_002_a>'].join('\n')
  },
  {
    label: 'r_column_tab_tit_002',
    documentation: '栏目标题tab切换002',
    insertText: ['<@r_column_tab_tit_002 ${1:editor1} ids=[] extraClasses="" extraStyle="">', '    ${2:content}', '</@r_column_tab_tit_002>'].join('\n')
  },
  {
    label: 'r_more_003',
    documentation: '更多按钮003',
    insertText: ['<@r_more_003 ${1:editor1} data={} extraClasses="" extraStyle="">', '    ${2:content}', '</@r_more_003>'].join('\n')
  }
]

export const jsonSnippets = [
  {
    label: 'editor',
    documentation: '配置对象',
    insertText: ['"editor${1:1}": {', '    "_key": "editor${1:1}",', '    "type": "${2:common}",', '    "title": "${3:元素描述}",', '},'].join('\n')
  },
  {
    label: 'margin',
    documentation: '外边距配置',
    insertText: [
      '"margin": {',
      '    "isDefault": true,',
      '    "topPxValue": ${1:0},',
      '    "rightPxValue": ${2:0},',
      '    "bottomPxValue": ${3:0},',
      '    "leftPxValue": ${4:0},',
      '    "top": ${5:0},',
      '    "right": ${6:0},',
      '    "bottom": ${7:0},',
      '    "left": ${8:0}',
      '},'
    ].join('\n')
  },
  {
    label: 'padding',
    documentation: '内边距配置',
    insertText: [
      '"padding": {',
      '    "isDefault": true,',
      '    "topPxValue": ${1:0},',
      '    "rightPxValue": ${2:0},',
      '    "bottomPxValue": ${3:0},',
      '    "leftPxValue": ${4:0},',
      '    "top": ${5:0},',
      '    "right": ${6:0},',
      '    "bottom": ${7:0},',
      '    "left": ${8:0}',
      '},'
    ].join('\n')
  },
  {
    label: 'background',
    documentation: '背景配置',
    insertText: ['"background": {', '    "isDefault": true,', '    "type": "${1:color}",', '    "image": ${2:null},', '    "color": "${3:#ffffff}"', '},'].join('\n')
  },
  {
    label: 'width',
    documentation: '宽度配置',
    insertText: ['"width": {', '    "isDefault": true,', '    "pxValue": "${1:100px}",', '    "value": "${2:6rem}"', '},'].join('\n')
  },
  {
    label: 'height',
    documentation: '高度配置',
    insertText: ['"height": {', '    "isDefault": true,', '    "pxValue": "${1:40px}",', '    "value": "${2:2rem}"', '},'].join('\n')
  },
  {
    label: 'font',
    documentation: '字体配置',
    insertText: [
      '"fontSize": {',
      '    "isDefault": true,',
      '    "pxValue": ${1:14},',
      '    "value": ${2:36}',
      '},',
      '"fontWeight": {',
      '    "isDefault": true,',
      '    "value": ${3:400}',
      '},',
      '"color": {',
      '    "isDefault": true,',
      '    "value": "${4:#000000}"',
      '},'
    ].join('\n')
  },
  {
    label: 'link',
    documentation: '链接配置',
    insertText: [
      '"link": {',
      '    "isDefault": true,',
      '    "type": ${1:0},',
      '    "value": "${2:javascript:;}",',
      '    "value0": "javascript:;",',
      '    "value1": "",',
      '    "value2": "",',
      '    "value3": ""',
      '},'
    ].join('\n')
  },
  {
    label: 'content',
    documentation: '内容配置',
    insertText: ['"content": {', '    "isDefault": true,', '    "canChoose": ${1:true},', '    "type": "${2:custom}",', '    "custom": "${3:自定义文本}"', '},'].join('\n')
  },
  {
    label: 'border',
    documentation: '边框配置',
    insertText: [
      '"borderTop": {',
      '    "isDefault": true,',
      '    "style": "solid",',
      '    "color": "${1:#000000}",',
      '    "widthPxValue": ${2:0},',
      '    "width": "${3:0.1rem}"',
      '},',
      '"borderRight": {',
      '    "isDefault": true,',
      '    "style": "solid",',
      '    "color": "${4:#000000}",',
      '    "widthPxValue": ${5:0},',
      '    "width": "${6:0.1rem}"',
      '},',
      '"borderBottom": {',
      '    "isDefault": true,',
      '    "style": "solid",',
      '    "color": "${7:#000000}",',
      '    "widthPxValue": ${8:0},',
      '    "width": "${9:0.1rem}"',
      '},',
      '"borderLeft": {',
      '    "isDefault": true,',
      '    "style": "solid",',
      '    "color": "${10:#000000}",',
      '    "widthPxValue": ${11:0},',
      '    "width": "${12:0.1rem}"',
      '},'
    ].join('\n')
  },
  {
    label: 'hover',
    documentation: '鼠标悬停效果配置',
    insertText: ['"hover": {', '    "isDefault": true,', '    "color": "${1:}",', '    "borderColor": "${2:}",', '    "backgroundColor": "${3:}"', '},'].join('\n')
  },
  {
    label: 'contentOrigin',
    documentation: '内容来源配置',
    insertText: ['"contentOrigin": {', '    "type": "${1:category}",', '    "category": ${2:0},', '    "content": [],', '    "class": "${3:page0}"', '},'].join('\n')
  },
  {
    label: 'categoryOrigin',
    documentation: '栏目选择配置',
    insertText: ['"categoryOrigin": {', '    "value": []', '},'].join('\n')
  },
  {
    label: 'swiper',
    documentation: '轮播图配置',
    insertText: [
      '"swiper": {',
      '    "isDefault": true,',
      '    "value": [',
      '        {',
      '            "isUse": true,',
      '            "image": "${1:}",',
      '            "frontImage": "",',
      '            "frontPosition": "center",',
      '            "description": "${2:}",',
      '            "url": "javascript:;",',
      '            "open": "self"',
      '        }',
      '    ]',
      '},'
    ].join('\n')
  },
  {
    label: 'friend',
    documentation: '友情链接配置',
    insertText: [
      '"friend": {',
      '    "isDefault": true,',
      '    "nested": true,',
      '    "value": [',
      '        {',
      '            "id": ${1:1},',
      '            "name": "${2:}",',
      '            "logo": "${3:}",',
      '            "url": "${4:}",',
      '            "description": "",',
      '            "open": "_blank",',
      '            "children": []',
      '        }',
      '    ]',
      '},'
    ].join('\n')
  },
  {
    label: 'richText',
    documentation: '富文本配置',
    insertText: ['"richText": {', '    "isDefault": true,', '    "value": "${1:}"', '},'].join('\n')
  },
  {
    label: 'service',
    documentation: '服务号配置',
    insertText: [
      '"service": {',
      '    "isDefault": true,',
      '    "value": [',
      '        {',
      '            "qrCode": "${1:}",',
      '            "name": "${2:微信服务号}",',
      '            "logo": "${3:}"',
      '        }',
      '    ]',
      '},'
    ].join('\n')
  },
  {
    label: 'lineClamp',
    documentation: '文本行数限制',
    insertText: ['"lineClamp": {', '    "isDefault": true,', '    "value": ${1:3}', '},'].join('\n')
  },
  {
    label: 'fontStyle',
    documentation: '字体样式配置',
    insertText: ['"italic": {', '    "isDefault": true,', '    "value": false', '},', '"underline": {', '    "isDefault": true,', '    "value": false', '},'].join('\n')
  },
  {
    label: 'animation',
    documentation: '动画配置',
    insertText: ['"aos": {', '    "isDefault": true,', '    "value": "${1:zoom-in}"', '},', '"delay": {', '    "isDefault": true,', '    "value": ${2:300}', '},'].join('\n')
  },
  {
    label: 'opacity',
    documentation: '透明度配置',
    insertText: ['"opacity": {', '    "isDefault": true,', '    "value": ${1:1}', '},'].join('\n')
  },
  {
    label: 'position',
    documentation: '位置配置',
    insertText: [
      '"position": {',
      '    "isDefault": true,',
      '    "type": "${1:relative}",',
      '    "top": "${2:0rem}",',
      '    "right": "${3:0rem}",',
      '    "bottom": "${4:0rem}",',
      '    "left": "${5:0rem}"',
      '},'
    ].join('\n')
  }
]
